home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / ext / standard / fsock.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-26  |  2.9 KB  |  93 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Paul Panotzki - Bunyip Information Systems                  |
  16.    |          Jim Winstead (jimw@php.net)                                 |
  17.    +----------------------------------------------------------------------+
  18. */
  19.  
  20. /* $Id: fsock.h,v 1.34 2001/02/26 06:07:17 andi Exp $ */
  21.  
  22. /* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */
  23.  
  24. #ifndef FSOCK_H
  25. #define FSOCK_H
  26.  
  27. #include "file.h"
  28.  
  29. #ifdef PHP_WIN32
  30. # ifndef WINNT
  31. #  define WINNT 1
  32. # endif
  33. # undef FD_SETSIZE
  34. # include "arpa/inet.h"
  35. # define socklen_t unsigned int
  36. #endif
  37.  
  38. #ifdef HAVE_NETINET_IN_H
  39. # include <netinet/in.h>
  40. #endif
  41.  
  42. #ifdef HAVE_SYS_SOCKET_H
  43. #include <sys/socket.h>
  44. #endif
  45.  
  46. #ifdef HAVE_SYS_TIME_H
  47. #include <sys/time.h>
  48. #endif
  49.  
  50. #define PHP_FSOCK_CHUNK_SIZE 8192
  51.  
  52. struct php_sockbuf {
  53.     int socket;
  54.     unsigned char *readbuf;
  55.     size_t readbuflen;
  56.     size_t readpos;
  57.     size_t writepos;
  58.     struct php_sockbuf *next;
  59.     struct php_sockbuf *prev;
  60.     char eof;
  61.     char persistent;
  62.     char is_blocked;
  63.     size_t chunk_size;
  64.     struct timeval timeout;
  65.     char timeout_event;
  66. };
  67.  
  68. typedef struct php_sockbuf php_sockbuf;
  69.  
  70. PHP_FUNCTION(fsockopen);
  71. PHP_FUNCTION(pfsockopen);
  72.  
  73. PHPAPI int php_lookup_hostname(const char *addr, struct in_addr *in);
  74. PHPAPI char *php_sock_fgets(char *buf, size_t maxlen, int socket);
  75. PHPAPI size_t php_sock_fread(char *buf, size_t maxlen, int socket);
  76. PHPAPI int php_sock_feof(int socket);
  77. PHPAPI int php_sock_fgetc(int socket);
  78. PHPAPI int php_is_persistent_sock(int);
  79. PHPAPI int php_sockset_blocking(int socket, int mode);
  80. PHPAPI void php_sockset_timeout(int socket, struct timeval *timeout);
  81. PHPAPI int php_sockdestroy(int socket);
  82. PHPAPI int php_sock_close(int socket);
  83. PHPAPI size_t php_sock_set_def_chunk_size(size_t size);
  84. PHPAPI void php_msock_destroy(int *data);
  85. PHPAPI void php_cleanup_sockbuf(int persistent FLS_DC);
  86.  
  87. PHPAPI int connect_nonb(int sockfd, struct sockaddr *addr, socklen_t addrlen, struct timeval *timeout);
  88. PHPAPI struct php_sockbuf *php_get_socket(int socket);
  89.  
  90. PHP_RSHUTDOWN_FUNCTION(fsock);
  91.  
  92. #endif /* FSOCK_H */
  93.